
/*

INITIALIZE COLUMNS AND PANELS

	Creating a Column and Panel Layout:

	 - If you are not using panels then these columns are not required.
	 - If you do use panels, the main column is required. The side columns are optional.

	 Columns
	 - Create your columns from left to right.
	 - One column should not have it's width set. This column will have a fluid width.

	 Panels
	 - After creating Columns, create your panels from top to bottom, left to right.
	 - One panel in each column should not have it's height set. This panel will have a fluid height.
	 - New Panels are inserted at the bottom of their column.

-------------------------------------------------------------------- */


initializeColumns = function() {

	/*
	Distribution des colonnes principales
	*/

	new MUI.Column({
		id: 'mainColumn',
		placement: 'main',
		resizeLimit: [100, 300],
		sortable: false
	});

	new MUI.Column({
		id: 'sideColumn2',
		placement: 'right',
		width: 300,
		resizeLimit: [200, 300],
		sortable: false,
		isCollapsed: false
	});

	/*
	Remplissage des colonnes
	*/

	// Add panels to main column
	new MUI.Panel({
		id: 'mainPanel',
		title: 'Tableau de bord',
		contentURL: '/Tb/',
		column: 'mainColumn'
	});

	// Add panels to second side column
	new MUI.Panel({
		id: 'panel1',
		title: 'Logs',
		contentURL: '/Logs/',
		column: 'sideColumn2',
		height: 150,
		/*
		onContentLoaded: function(response) {
			//MUI.produit_block_search();
		}
		*/
	});

	new MUI.Panel({
		id: 'panel2',
		title: 'ProjectExplorer',
		contentURL: '/ProjectExplorer/',
		column: 'sideColumn2',
		height: 150,
		/*
		onContentLoaded: function(response) {
			MUI.caddy_afficher();
		}
		*/
	});

	//
	// ----------
	//

	MUI.splitPanelPanel = function() {
		if ($('mainPanel')) {
			new MUI.Column({
				container: 'mainPanel',
				id: 'sideColumn3',
				placement: 'left',
				width: 200,
				resizeLimit: [100, 300]
			});

			new MUI.Column({
				container: 'mainPanel',
				id: 'mainColumn2',
				placement: 'main',
				width: null,
				resizeLimit: [100, 300]
			});

			new MUI.Panel({
				header: false,
				id: 'splitPanel_mainPanel',
				contentURL: 'license.html',
				column: 'mainColumn2'
			});

			new MUI.Panel({
				header: false,
				id: 'splitPanel_sidePanel',
				addClass: 'panelAlt',
				contentURL: 'pages/lipsum.html',
				column: 'sideColumn3'
			});
		}
	};

	MUI.myChain.callChain();
};
